package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author XingDong
 */
@RestController
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 人员实名认证接口")
public class WorkerCertificationController {

    @Resource
    private IWorkerCertificationService workerCertificationService;

    /**
     * @param dto 认证模型
     * @author XingDong
     */
    @PostMapping
    @ApiOperation("服务人员端提交认证")
    public void addWorkerCertification(@Valid @RequestBody WorkerCertificationAuditAddReqDTO dto) {
        workerCertificationService.addWorkerCertification(dto);
    }

    /**
     * @author XingDong
     */
    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public WorkerCertificationAuditResDTO getRejectReason() {
        return workerCertificationService.getRejectReason();
    }
}
